package com.mp.approvalreq.dao;

import com.mp.approvalreq.entity.*;
import com.mp.user.entity.User;

import java.sql.SQLException;

/**
 * 模板dao
 *
 * @author Administrator
 */
public interface SubmitRequestDao {


	/**
	 * 获取审批导出的邮箱
	 */
	Email getExportEmail(User user) throws Throwable;

	/**
	 * 保存审批导出邮箱
	 */
	void saveExportEmail(Email email, User user) throws Throwable;

	/**
	 * 插入个人工作状态
	 *
	 * @param request
	 * @return
	 */
	Request getRequestRefuseChain(Request request) throws Throwable;

	/**
	 * update审批已重新提交
	 *
	 * @param requestId
	 * @param companyId
	 * @throws Throwable
	 */
	void updateRequestResubmit(int requestId, int companyId) throws Throwable;

	/**
	 * 获得当月某审批模板使用的次数，这里有个bug就是，目前只有未打卡的需求，所以是根据模板类型来搜索的，如果以后某个自定义的要这样，那就有bug了
	 *
	 * @param
	 * @param
	 * @throws Throwable
	 */
	int getTimesCurrentMonthPersonUsed(int companyInfoId, int templateType) throws Throwable;


	/**
	 * 判断一个页面内是否重复提交
	 *
	 * @param companyId
	 * @param contactIdSubmitTime
	 * @return
	 * @throws SQLException
	 */
	boolean isSubmitAgain(Integer companyId, String contactIdSubmitTime) throws SQLException;
}
